extends "../calxJS_Hide/calxJS_Hide.gd"
func _init():
	pass
func _extInit():
	._extInit()
	chaName = "小梅卡"                   # 角色的名称
	attCoe.atkRan = 2                 # 攻击距离
	attCoe.maxHp = 5                  # 最大生命（每点代表112.5基础数值，取整数，下同）
	attCoe.atk = 3                    # 攻击力（每点代表8.5）
	attCoe.mgiAtk = 6.5                 # 魔法攻击（每点代表13.7）
	attCoe.def = 4                    # 物理防御（每点代表15）
	attCoe.mgiDef = 4                 # 魔法防御（每点代表16.6）
	atkEff = "atk_dang" 
	xb = "水"
	lv = 3    
	addSkillTxt("[似水流年]流年岁月静如水，回复自身已损失体力值40%，下个CD技能伤害提升50%[CD:8]")
	addSkillTxt("[流水灯]释放前行的海浪攻击敌方单体，造成200%光系魔法伤害，造成伤害的30%用于回复自身体力值\n20%概率额外造成目标25%当前体力的伤害，若克制目标则提升10%攻速，最高60%[CD:13]")
	addSkillTxt("[广寒涧]广寒激流攻击敌方单体，造成160%的水系魔法伤害，命中后令目标<溺水>5秒\n攻击时若目标体力值大于30%则削弱目标魔防20%[CD:11]")
	addCdSkill("ssln",8)
	addCdSkill("lsd",13)
	addCdSkill("ghj",11)


var ln = 0
func _castCdSkill(id):
	._castCdSkill(id)
	if id == "ssln":
		plusHp((att.maxHp - att.hp)*0.4)
		ln += 1
	if id == "lsd":
		var dmg = att.mgiAtk*2
		var txt = "流水灯"
		if ln >= 1:
			ln -= 1
			dmg *= 1.5
			txt = "源·" + txt
		var eff = sys.newEff("numHit", position, false, 1)
		eff.setText(txt, "#FF0099")
		eff.anim.set_speed_scale(0.2)
		typeHurtCha(aiCha,dmg,Chara.HurtType.PHY,Chara.AtkType.SKILL,"光")
		if aiCha.xb == "火":
			var buff = hasBuff("gognsu1")
			if buff == null:
				addBuff(bf.gongsu1.new())
			elif buff.att.spd < 0.6:
				buff.att.spd += 0.1
		if aiCha.xb == "暗":
			var buff = hasBuff("gognsu1")
			if buff == null:
				addBuff(bf.gongsu1.new())
			elif buff.att.spd < 0.6:
				buff.att.spd += 0.1
		if id == "ghj":
			var dmg1 = att.mgiAtk*1.6
			var txt1 = "广寒涧"
			if ln >= 1:
				ln -= 1
				dmg1 *= 1.5
				txt = "源·" + txt1
			var eff1 = sys.newEff("numHit", position, false, 1)
			eff1.setText(txt, "#FF0099")
			eff1.anim.set_speed_scale(0.2)
			typeHurtCha(aiCha,dmg1,Chara.HurtType.PHY,Chara.AtkType.SKILL)
			aiCha.addBuff(bf.nishui.new(5))
			if aiCha.att.maxHp - aiCha.att.hp > aiCha.att.maxHp*0.3:
				addBuff(mofang.new())


class mofang:
	extends Buff
	func _init():
		attInit()
		var dispelable = false
		id = "mofang"	
		att.mgiDefL -= 0.2

func _onBattleStart():
	._onBattleStart()
	ln = 0